/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.sispro.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author felipe
 */
@Entity
@Table(name = "funcaocomputacional")
@NamedQueries({
    @NamedQuery(name = "FuncaoComputacional.findAll", query = "SELECT f FROM FuncaoComputacional f"),
    @NamedQuery(name = "FuncaoComputacional.findByIdFuncaoComputacional", query = "SELECT f FROM FuncaoComputacional f WHERE f.idFuncaoComputacional = :idFuncaoComputacional"),
    @NamedQuery(name = "FuncaoComputacional.findByFuncao", query = "SELECT f FROM FuncaoComputacional f WHERE f.funcao = :funcao")})
public class FuncaoComputacional implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idFuncaoComputacional")
    private Integer idFuncaoComputacional;
    @Basic(optional = false)
    @Column(name = "funcao")
    private String funcao;
    @JoinColumn(name = "TipoUsuario_idTipoUsuario", referencedColumnName = "idTipoUsuario")
    @ManyToOne(optional = false)
    private TipoUsuario tipoUsuarioidTipoUsuario;

    public FuncaoComputacional() {
    }

    public FuncaoComputacional(Integer idFuncaoComputacional) {
        this.idFuncaoComputacional = idFuncaoComputacional;
    }

    public FuncaoComputacional(Integer idFuncaoComputacional, String funcao) {
        this.idFuncaoComputacional = idFuncaoComputacional;
        this.funcao = funcao;
    }

    public Integer getIdFuncaoComputacional() {
        return idFuncaoComputacional;
    }

    public void setIdFuncaoComputacional(Integer idFuncaoComputacional) {
        this.idFuncaoComputacional = idFuncaoComputacional;
    }

    public String getFuncao() {
        return funcao;
    }

    public void setFuncao(String funcao) {
        this.funcao = funcao;
    }

    public TipoUsuario getTipoUsuarioidTipoUsuario() {
        return tipoUsuarioidTipoUsuario;
    }

    public void setTipoUsuarioidTipoUsuario(TipoUsuario tipoUsuarioidTipoUsuario) {
        this.tipoUsuarioidTipoUsuario = tipoUsuarioidTipoUsuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFuncaoComputacional != null ? idFuncaoComputacional.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FuncaoComputacional)) {
            return false;
        }
        FuncaoComputacional other = (FuncaoComputacional) object;
        if ((this.idFuncaoComputacional == null && other.idFuncaoComputacional != null) || (this.idFuncaoComputacional != null && !this.idFuncaoComputacional.equals(other.idFuncaoComputacional))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.sispro.model.FuncaoComputacional[ idFuncaoComputacional=" + idFuncaoComputacional + " ]";
    }
    
}
